import Vue from 'vue'
import VueRouter from 'vue-router'
import Manage from "@/views/Manage";
import Login from "@/views/Login";
import Register from "@/views/Register";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Manage',
    component: Manage,
    redirect:"/home",
    children:[
      {path: 'home', name: 'Home', component:()=>import('../views/Home.vue')},
      {path: 'user', name: 'User', component:()=>import('../views/User.vue')},
      {path: 'person', name: 'Person', component:()=>import('../views/Person.vue')},
      {path: 'file', name: 'File', component: () => import('../views/File.vue')},
      {path: 'role', name: 'Role', component: () => import('../views/Role.vue')},
      {path: 'menu', name: 'Menu', component: () => import('../views/Menu.vue')},
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})


export default router
